local skynet = require "skynet"

skynet.init(function()
  skynet.error("[globaltest] skynet.init triggered")
end)

skynet.start(function()
  skynet.error("[uniqmain] start")

  -- 启动全局唯一服务两次
  local uid1 = skynet.uniqueservice("myuniquesvc")
  local uid2 = skynet.uniqueservice("myuniquesvc")

  skynet.error("[uniqmain] uniqueservice 1:", skynet.address(uid1))
  skynet.error("[uniqmain] uniqueservice 2:", skynet.address(uid2))

  -- 启动普通服务两次
  local sid1 = skynet.newservice("mycommonsvc")
  local sid2 = skynet.newservice("mycommonsvc")

  skynet.error("[uniqmain] newservice 1:", skynet.address(sid1))
  skynet.error("[uniqmain] newservice 2:", skynet.address(sid2))

  skynet.exit()
end)
